package com.boge.study.design_pattern.observer.jdk;

public class ObserverTest {

	public static void main(String[] args) {
		//创建目标
		ConcreteWeatherSubject subject = new ConcreteWeatherSubject();

		//创建观察者
		ConcreteObserver observer = new ConcreteObserver();
		observer.setObserverName("路人甲");
		observer.setRemindThing("宅在家里");

		//注册观察者
		subject.addObserver(observer);

		//目标发布天气信息
		subject.setContent("今天有雨");
		
	}
	
}
